const initState = { n: 0 }
export default function reducer(prevState = initState, action) {
    let { type, data } = action;
    switch (type) {
        case 'add':
            return { n: prevState.n + data }
        case 'dis':
            return { n: prevState.n - data }

        default:
            return prevState;
    }
}